﻿<script src="~/vue/dist/vue.global.js"></script>
<link href="~/element-plus/dist/index.css" rel="stylesheet" />
<script src="~/element-plus/dist/index.full.js"></script>
<script src="~/axios/dist/axios.js"></script>
<div id="app">
    <el-text class="mx-1">
        您正在做的业务是：人力资源--招聘管理--录用管理--录用查询
    </el-text>
    <br/>
    <el-table :data="tableData" style="width: 100%" :row-class-name="tableRowClassName">
        <el-table-column prop="humanName" label="姓名"></el-table-column>
        <el-table-column prop="humanSex" label="性别"></el-table-column>
        <el-table-column prop="humanAge" label="年龄"></el-table-column>
        <el-table-column prop="humanMajorKindName" label="职位类别"></el-table-column>
        <el-table-column prop="hunmaMajorName" label="职位昵称"></el-table-column>
        <el-table-column prop="humanCollege" label="毕业院校"></el-table-column>
        <el-table-column prop="humanEducatedMajor" label="学历专业"></el-table-column>
        <el-table-column align="right" label="查询">
            <template #default="scope">
                <el-button size="small"
                           type="primary"
                           v-on:click="UpdateEMR(scope.row)">
                    查询
                </el-button>
            </template>
        </el-table-column>
    </el-table>


    <div id="pageDiv">
        <span class="span1">  总数：{{pageCount}} 例    当前第{{pageIndex}}页 /每页显示 {{pageSize}} 条    共 {{page}} 页  </span>
        <div class="div">
            <button v-on:click="HomePage()">首页</button>
            <button v-on:click="PreviousPage()">上一页</button>
            <button v-on:click="NextPage()">下一页</button>
            <button v-on:click="LastPage()">尾页</button>
            跳到第
            <input type="text" style="width: 30px;height: 20px;" v-model="pages">
            <a>页</a>
            <button v-on:click="GoTo()">
                <img src="~/images/go.bmp" />
            </button>
        </div>
    </div>
</div>

<script>

    const { createApp, ref, reactive, computed } = Vue
    const { ElMessage } = ElementPlus
    var app = createApp({
        setup() {
            const MreId = ref()
            const tableData = ref([])
            const pageCount = ref()//总记录数
            const pageIndex = ref(1)//当前页数
            const pageSize = ref(5)//每页显示数
            const page = computed(() => {
                return Math.ceil(pageCount.value / pageSize.value)
            });//总页数
            const pages = ref()//跳转到的页数
            const PassCheckComment = ref("通过")
            const PassPassComment = ref("通过")


            //分页查询
            function fill() {
                axios.get("/ER/SelectLYSQ", {
                    params: {
                        PassPassComment:PassPassComment.value,
                        PassCheckComment:PassCheckComment.value,
                        pageIndex: pageIndex.value,
                        pageSize: pageSize.value
                    }
                }).then(res => {
                    tableData.value = res.data
                }).catch(err => {
                    console.info("CMKSelect报错,报错信息:" + err);
                })
            }
            //查询总条数
            function Count() {
                axios.get("/EMR/EMRSelectCount").then(res => {
                    pageCount.value = res.data
                }).catch(Error => {
                    console.info(Error)
                })
            }

            function UpdateEMR(row) {
                console.info(row.resId)
                window.location.href = "/ER/IndexLYCX1?id=" + row.resId;
            }


            //首页
            function HomePage() {
                pageIndex.value = 1;
                fill();
            }

            //上一页
            function PreviousPage() {
                if (pageIndex.value != 1) {
                    pageIndex.value -= 1;
                    fill();
                }
            }

            //下一页
            function NextPage() {
                if (pageIndex.value != page.value) {
                    pageIndex.value += 1;
                    fill();
                }
            }

            //尾页
            function LastPage() {
                pageIndex.value = page.value;
                fill();
            }


            //转到页数
            function GoTo() {
                if (!isNaN(pages.value)) {
                    if (pages.value > page.value || pages.value < 1) {
                        alert("输入的页数有误！")
                        pages.value = ""
                    } else {
                        pageIndex.value = Number(pages.value)
                        pages.value = ""
                        fill();
                    }
                } else {
                    alert('你输入的不是数字！')
                }
            }
            Count();
            fill();

            return {
                GoTo,
                LastPage,
                NextPage,
                PreviousPage,
                HomePage,
                UpdateEMR,
                MreId,
                tableData,
                pageCount,
                pageIndex,
                pageSize,
                page,
                pages,
                PassCheckComment


            }
        }
    })
    app.use(ElementPlus)
    app.mount("#app");

</script>

<style>
    body {
        background-color: #ffffcc;
    }

    .div {
        width: 410px;
        height: 25px;
        /* background-color: black; */
        margin-left: 400px;
        margin-top: -26px;
        line-height: 25px;
    }

    .span1 {
        font-size: 15px;
    }

    .div button {
        margin: 0 5px;
        background-color: #00000000;
        border: 0px;
    }

    .div a {
        margin: 0 5px;
    }

    a {
        text-decoration: none;
        color: white;
    }

    #pageDiv {
        padding: 10px;
    }

    tbody, td, tfoot, th, thead, tr {
        border-color: inherit;
        background-color: #ffffbb;
        border-style: solid;
        border-width: 0;
    }

    .tableEdit {
        border: solid 1px #B5D6E6;
        border-collapse: collapse;
        width: 99%;
        margin: 5px;
    }

        .tableEdit th {
            text-align: left;
            padding: 5px 8px;
            border: solid 1px #B5D6E6;
            width: 35%;
            background-color: #ffdb6f;
        }

        .tableEdit td {
            width: 65%;
            text-align: left;
            padding: 5px 8px;
            border: solid 1px #B5D6E6;
        }

        .tableEdit thead {
            border: solid 1px #B5D6E6;
            background-color: #C1EBFF;
            padding: 5px;
            font-weight: bold;
        }

            .tableEdit thead tr td {
                font-size: 18px;
                color: #000;
            }
</style>